<?php
/**
 * ARTimestamp Model Class File
 *
 * @package
 * @author
 */

/**
 * This is the model class for table "{{artimestamp}}".
 *
 * The followings are the available columns in table '{{artimestamp}}':
 * @property integer $id
 * @property string $tableName
 * @property string $foreignKey
 * @property integer $tsCreated
 * @property integer $userIdCreated
 * @property integer $tsUpdated
 * @property integer $userIdUpdated
 *
 * @package
 * @author
 */
class ARTimestamp extends MyModel
{
    // {{{ *** Members ***

    /**
     * List of fields composing the record name (separated by ;)
     * @var string
     */
    var $nameFields = "id";

    /**
     * Name format string (e.g. '{1} (#{2})' 
     * @var string
     */
    var $nameFormat = "{1}";
    
    /**
     * Does this model use record revisions?
     * @var bool
     */
    var $usesRevision   = false;

    /**
     * Revision number of current record
     * @var int
     */
    var $recordRevision;

    /**
     * Does this model use logging?
     * @var bool
     */
    var $usesLog        = false;

    // }}} 
    // {{{ *** Methods ***
    // {{{ model
    /**
     * Returns the static model of the specified AR class.
     * @return ARTimestamp the static model class
     */
    public static function model($className=__CLASS__)
    {
        return parent::model($className);
    } // }}} 
    // {{{ tableName
    /**
     * @return string the associated database table name
     */
    public function tableName()
    {
        return '{{ARTimestamp}}';
    } // }}} 
    // {{{ rules
    /**
     * @return array validation rules for model attributes.
     */
    public function rules()
    {
        // NOTE: you should only define rules for those attributes that
        // will receive user inputs.
        return array(
            array('tableName, foreignKey, tsCreated, userIdCreated', 'required','on'=>'insert'),
            array('tableName, foreignKey, tsUpdated, userIdUpdated', 'required','on'=>'update'),
            array('tsCreated, userIdCreated, tsUpdated, userIdUpdated', 'numerical', 'integerOnly'=>true),
            array('tableName, foreignKey', 'length', 'max'=>255),
            // The following rule is used by search().
            // Please remove those attributes that should not be searched.
            array('id, tableName, foreignKey, tsCreated, userIdCreated, tsUpdated, userIdUpdated', 'safe', 'on'=>'search'),
        );
    } // }}} 
    // {{{ relations
    /**
     * @return array relational rules.
     */
    public function relations()
    {
        // NOTE: you may need to adjust the relation name and the related
        // class name for the relations automatically generated below.
        return array(
        );
    } // }}} 
    // {{{ attributeLabels
    /**
     * @return array customized attribute labels (name=>label)
     */
    public function attributeLabels()
    {
        return array(
            'id' => Yii::t('site','ID'),
            'tableName' => Yii::t('site','Table Name'),
            'foreignKey' => Yii::t('site','Foreign Key'),
            'tsCreated' => Yii::t('site','Ts Created'),
            'userIdCreated' => Yii::t('site','User Id Created'),
            'tsUpdated' => Yii::t('site','Ts Updated'),
            'userIdUpdated' => Yii::t('site','User Id Updated'),
        );
    } // }}} 
    // {{{ search
    /**
     * Retrieves a list of models based on the current search/filter conditions.
     * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
     */
    public function search()
    {
        // Warning: Please modify the following code to remove attributes that
        // should not be searched.

        $criteria=new CDbCriteria;

		$criteria->compare('id',$this->id);
		$criteria->compare('tableName',$this->tableName,true);
		$criteria->compare('foreignKey',$this->foreignKey,true);
		$criteria->compare('tsCreated',$this->tsCreated);
		$criteria->compare('userIdCreated',$this->userIdCreated);
		$criteria->compare('tsUpdated',$this->tsUpdated);
		$criteria->compare('userIdUpdated',$this->userIdUpdated);
        return new CActiveDataProvider(get_class($this), array('criteria'=>$criteria));
    } // }}} 
    // }}} 
}

/* vim: set ai sw=4 sts=4 et fdm=marker fdc=4 */ 
?>
